---
import type { InferGetStaticParamsType, InferGetStaticPropsType } from "astro"
import {  getCollection } from "astro:content"
import BlogPost from "@layouts/BlogPost.astro"

export async function getStaticPaths() {
  const posts = await getCollection("blog")
  return posts.map((post) => ({
    params: { slug: post.slug },
    props: post,
  }))
}
// type Params = InferGetStaticParamsType<typeof getStaticPaths>
type Props = InferGetStaticPropsType<typeof getStaticPaths>


const { data} = Astro.props

const { Content } = await Astro.props.render();
import Layout from "@layouts/Layout.astro"



// import Layout from "@layouts/Layout.astro"
---
<Layout content={(data.title,data.description)}>
<BlogPost {...data}>

<Content />

</BlogPost>
</Layout>